package com.example.demo.smartLamp.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.common.ApiResponse;
import com.example.demo.smartLamp.entity.request.UserInfoGetRequest;
import com.example.demo.smartLamp.entity.request.WarnGetAllInfoRequest;
import com.example.demo.smartLamp.entity.response.UserInfoGetResponse;
import com.example.demo.smartLamp.entity.response.WarnGetAllInfoResponse;
import com.example.demo.smartLamp.service.IWarnService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 祁荣博 胡绍宇
 * @since 2022-07-27
 */
@RestController
@RequestMapping("/smartLamp/warn")
public class WarnController {

    @Resource
    IWarnService warnService;

    @ApiOperation(value="获取报警全部信息")
    @PostMapping("/getAllInfo")
    public ApiResponse warngetInfo(
            @RequestBody WarnGetAllInfoRequest warnGetAllInfoRequest
    ) throws Exception {
        Page<WarnGetAllInfoResponse> returnPost = warnService.warnGetAllInfo(warnGetAllInfoRequest);
        return ApiResponse.success(returnPost);
    }

}
